package med;

import java.util.Iterator;

import libsvm.svm_node;
import med.config.Config;

enum Type {
	Unknown, 
	Unknown2, 
	ConfernceName, 
	ConferenceDate, 
	ConferncePlace, 
	NameAbbrevation, 
	CameraReadyDate, 
	Committee, 
	PaperSubmitionDate, 
	AcceptanceDate, 
	PaperSubmitionAbstract,
	RegistrationDate,
}

public abstract class Element {
	protected String mValue;
	protected Type type = Type.Unknown;
	private Vector vector;
	
	Element(String i_Value, Vector i_Vector)
	{
		mValue = i_Value;
		vector = i_Vector;
	}
	
	Element(Vector i_vector)
	{
		vector = i_vector;
		mValue = "";
		if (vector.getWords().size() >= Config.getInstance()
				.getTagPositionParam()) {
			Iterator<String> it = vector.getWords().listIterator(
					Config.getInstance().getTagPositionParam());
			while (it.hasNext()) {
				mValue += it.next() + ' ';
			}
		}
	}
	
	public String getValue()
	{
		return mValue;
	}
	
	public svm_node[] getSvmNode()
	{
		return vector.getSvmNode();
	}

	public Vector getVetor() {
		return vector;
	}

	public void setVetor(Vector vetor) {
		this.vector = vetor;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public void print() {
		System.out.println(this.toString());
		
	}
	
	@Override
	public String toString() {
		return "Klasa: " + type.name() +" zawartosc: " + mValue;
	}
}
